package com.minshenglife.zanzan.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.minshenglife.zanzan.dao.EMOUserGroupDao;
import com.minshenglife.zanzan.entity.EMOUserGroup;
import com.minshenglife.zanzan.service.EMOUserService;

/**
 * emo用户
 * @author jianghaibo
 *
 */
@Component
@Transactional
public class EMOUserServiceImpl implements EMOUserService {
	Logger log = LoggerFactory.getLogger(EMOUserServiceImpl.class);
	@Resource
	private EMOUserGroupDao emoUserGroupDao;
	@Override
	public void add(EMOUserGroup emoUser) {
		emoUserGroupDao.add(emoUser);
	}
	@Override
	@Transactional(readOnly=true)
	public EMOUserGroup get(String empId) {
		EMOUserGroup emoUserGroup = new EMOUserGroup();
		emoUserGroup.setEmpId(empId);
		return emoUserGroupDao.getByEmpId(emoUserGroup);
	}
	@Override
	@Transactional(readOnly=true)
	public List<EMOUserGroup> findByUser(EMOUserGroup emoUser) {
		List<EMOUserGroup> userList = emoUserGroupDao.findByExample(emoUser);
		return userList;
	}
}
